|
|
|
|
|
|
|
Understand how to take advantage of the functions in Windows |
|
|
|
|
|
|
|
|
Learn where to find more information on the Windows API |
|
|
|
|
|
|
|
|
Learn to declare and call API functions |
|
|
|
|
|
|
|
|
Learn some tips for extending Visual Basic |
|
|
|
|
|
|
|
|
Build a class that returns system information |
|
|
|
|
|
|
|
|
Sample Project File: \Chapter28\WindowsAPI.vbp |
|
|
|
|
|
|
|
|
The Windows API (application programming interface) is a set of over 1,000 functions that can be used from Visual Basic or any language that can be programmed under Windows 95 or Windows NT. One of the reasons Windows programming has gotten the reputation of being hard to learn is due to the vast amount of functions you need to learn just to get started. Visual Basic uses many of these functions, but it makes them easier to learn by wrapping them into the BASIC language. Windows itself uses most of these functions to perform all its services. |
|
|
|
|
|
|
|
|
Although there are many API functions you can call, only some of them are really useful. Some are already duplicated within Visual Basic features, and others cannot be called from Visual Basic due to incompatibilities. In this chapter, youll learn some of the most useful API calls. |
|
|
|
|
|
|
|
|
The Windows API is normally used with the C and C++ languages. After all, Visual Basic is supposed to shield us from the complexities of programming for Windows. However, there are times when Visual Basic just cant do certain things. Also, for performance reasons, you might want to use a routine thats built into the Windows environment. Here are some reasons why you might want to use the Windows API: |
|
|
|
|
|
|
|
|
To manipulate the system Registry |
|
|
|
|
|
|
|
|
To retrieve system information, such as memory and operating system information |
|
|
|
|
|